﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_MasterPages/MainMasterPage.master" AutoEventWireup="true" CodeFile="Paper.aspx.cs" Inherits="Admin_Paper" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Main_HeaderContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main_MainContentPlaceHolder" runat="Server">
    <div id="background-blue4">
        background
    </div>
    <div class="page">
        <div class="page4">
            <div class="sidebar">
                <a href="../Default.aspx" id="logo">
                    <img id="Img1" runat="server" src="~/App_Themes/Default/images/logo.png" alt="logo" /></a>
                <ul>
                    <li class="home">
                        <a id="default_a" href="~/Admin/Confirm.aspx" runat="server">آزمایشات تایید شده</a></li>

                    <li class="about">
                        <a id="testlist_a" href="~/Admin/CategoryItem.aspx" runat="server">گروه آزمایشات</a></li>

                    <li class="projects">
                        <a id="paper_a" href="#" runat="server">کاربری</a></li>
                    <li class="selected blog">
                        <a id="gallery_a" href="#" runat="server">مدیریت سایت</a></li>

                    <li class="contact">
                        <a id="logout_a" href="#" runat="server" onclick="if(!confirm('آیا قصد خروج از سیستم را دارید؟')) return false;" onserverclick="LogoutButton_Click">خروج از سیستم</a></li>
                </ul>
            </div>
            <div class="body">
               <div>
                   <div>
                       <h3>مقالات</h3>
                   </div>
                   <div>
                       <table style="width: 100%" title="مقاله">
                           <tr>
                               <td style="width: 90px">عنوان مقاله:
                               </td>
                               <td style="width: 250px">
                                   <asp:TextBox ID="PaperTitleTextBox" runat="server" Width="250px"></asp:TextBox>
                               </td>
                               <td style="width: 90px">سایز صفحه:
                               </td>
                               <td style="width: 100px">
                                   <asp:DropDownList ID="PageSizeDropDownList" SkinID="SearchDropDownList" runat="server">
                                       <asp:ListItem Selected="True" Value="5">[پیش فرض]</asp:ListItem>
                                       <asp:ListItem Value="5">5 رکورد</asp:ListItem>
                                       <asp:ListItem Value="10">10 رکورد</asp:ListItem>
                                       <asp:ListItem Value="15">15 رکورد</asp:ListItem>
                                       <asp:ListItem Value="20">20 رکورد</asp:ListItem>
                                       <asp:ListItem Value="25">25 رکورد</asp:ListItem>
                                       <asp:ListItem Value="1000000">تمام رکورد ها</asp:ListItem>
                                   </asp:DropDownList>
                               </td>
                               <td style="width: 80px">
                                   <asp:ImageButton ID="SearchImageButton" runat="server" OnClick="SearchImageButton_Click"
                                       SkinID="SearchButton" />
                                   <asp:ImageButton ID="ClearImageButton" runat="server" OnClick="ClearImageButton_Click"
                                       OnClientClick="return false;" SkinID="ClearButton" />
                               </td>
                           </tr>
                           <tr>
                               <td colspan="5">
                                   <table>
                                       <tr>
                                           <td style="width: 353px;" valign="top">
                                               <asp:GridView ID="PaperGridView" runat="server" AutoGenerateColumns="False"
                                                   DataKeyNames="PaperID" DataSourceID="PaperEntityDataSource" HorizontalAlign="Center"
                                                   OnSelectedIndexChanged="PaperGridView_SelectedIndexChanged" PageSize="5" Width="300px" AllowSorting="True">
                                                   <Columns>
                                                       <asp:TemplateField>
                                                           <ItemTemplate>
                                                               <asp:ImageButton ID="SelectImageButton" runat="server" CommandName="Select" SkinID="SelectButton" />
                                                           </ItemTemplate>
                                                           <ItemStyle Width="25px" />
                                                       </asp:TemplateField>
                                                       <asp:BoundField DataField="PaperID" Visible="False" />
                                                       <asp:BoundField DataField="PaperTitle" HeaderText="عنوان مقاله" SortExpression="PaperTitle">
                                                           <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                                       </asp:BoundField>
                                                   </Columns>
                                               </asp:GridView>
                                           </td>
                                           <td style="width: 20px"></td>
                                           <td valign="top" align="center">
                                               <asp:FormView ID="PaperFormView" runat="server" DataSourceID="PaperEntityDataSource"
                                                   DataKeyNames="PaperID" DefaultMode="Insert" OnItemDeleted="PaperFormView_ItemDeleted"
                                                   OnItemCommand="PaperFormView_ItemCommand" Width="350px">
                                                   <EditItemTemplate>
                                                       <table border="0" cellpadding="0" cellspacing="0" style="width: 350px">
                                                           <tr valign="middle">
                                                               <td style="width: 80px" align="right">عنوان :
                                                               </td>
                                                               <td style="width: 270px" align="right">
                                                                   <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("PaperTitle") %>' MaxLength="500"
                                                                       Width="270px" />
                                                                   <asp:RequiredFieldValidator ID="TitleRequiredFieldValidator" runat="server" ControlToValidate="TitleTextBox"
                                                                       Display="Dynamic" ErrorMessage="*" ValidationGroup="Update"></asp:RequiredFieldValidator>
                                                               </td>
                                                           </tr>
                                                           <tr valign="middle">
                                                               <td style="width: 80px" align="right">تصویر  :
                                                               </td>
                                                               <td style="width: 270px" align="right">
                                                                   <asp:FileUpload ID="PicFileUpload" runat="server" Width="270px" />
                                                               </td>
                                                           </tr>
                                                           <tr valign="middle">
                                                               <td style="width: 80px" align="right">متن  :
                                                               </td>
                                                               <td></td>
                                                           </tr>
                                                           <tr valign="middle">
                                                               <td colspan="2" align="left" dir="rtl">
                                                                   <asp:TextBox ID="DescriptionTextBox" runat="server" Text='<%# Bind("Description") %>'
                                                                       TextMode="MultiLine" MaxLength="2500" Height="150px" Width="270px" />
                                                                   <asp:RequiredFieldValidator ID="PaperRequiredFieldValidator" runat="server" ControlToValidate="DescriptionTextBox"
                                                                       Display="Dynamic" ErrorMessage="*" ValidationGroup="Update"></asp:RequiredFieldValidator>
                                                               </td>
                                                           </tr>
                                                           <tr>
                                                               <td colspan="2" align="left">
                                                                   <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                                                                       <tr>
                                                                           <td style="height: 15px"></td>
                                                                           <td align="left" valign="top" style="width: 80px;"></td>
                                                                           <td align="left" valign="top" style="width: 80px;"></td>
                                                                           <td align="left" valign="top" style="width: 80px;"></td>
                                                                       </tr>
                                                                       <tr>
                                                                           <td style="height: 15px">&nbsp;
                                                                           </td>
                                                                           <td align="left" valign="top" style="width: 80px">
                                                                               <asp:ImageButton ID="DeleteImageButton" runat="server" CausesValidation="False" CommandName="Delete"
                                                                                   SkinID="DeleteButton" OnClientClick="if (!confirm('آيا از حذف مطمئن هستيد؟')) return false;" />
                                                                           </td>
                                                                           <td align="left" valign="top" style="width: 80px">
                                                                               <asp:ImageButton ID="UpdateImageButton" runat="server" CommandName="Update" SkinID="UpdateButton"
                                                                                   ValidationGroup="Update" OnClientClick="if (!confirm('آيا از اعمال تغییرات مطمئن هستيد؟')) return false;" />
                                                                           </td>
                                                                           <td align="left" valign="top" style="width: 80px">
                                                                               <asp:ImageButton ID="CancelImageButton" runat="server" CommandName="Cancel" SkinID="CancelButton" />
                                                                           </td>
                                                                       </tr>
                                                                   </table>
                                                               </td>
                                                           </tr>
                                                       </table>
                                                   </EditItemTemplate>
                                                   <InsertItemTemplate>
                                                       <table border="0" cellpadding="0" cellspacing="0" style="width: 350px">
                                                           <tr valign="middle">
                                                               <td style="width: 80px" align="right">عنوان :
                                                               </td>
                                                               <td style="width: 270px" align="right">
                                                                   <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("PaperTitle") %>' MaxLength="500"
                                                                       Width="270px" />
                                                                   <asp:RequiredFieldValidator ID="TitleRequiredFieldValidator" runat="server" ControlToValidate="TitleTextBox"
                                                                       Display="Dynamic" ErrorMessage="*" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                                                               </td>
                                                           </tr>
                                                           <tr valign="middle">
                                                               <td style="width: 80px" align="right">تصویر :
                                                               </td>
                                                               <td style="width: 270px" align="right">
                                                                   <asp:FileUpload ID="PicFileUpload" runat="server" Width="270px" />
                                                               </td>
                                                           </tr>
                                                           <tr valign="middle">
                                                               <td style="width: 80px" align="right">متن :
                                                               </td>
                                                               <td></td>
                                                           </tr>
                                                           <tr valign="middle">
                                                               <td colspan="2" align="left" dir="rtl">
                                                                   <asp:TextBox ID="DescriptionTextBox" runat="server" Text='<%# Bind("Description") %>'
                                                                       TextMode="MultiLine" MaxLength="2500" Height="150px" Width="270px" />
                                                                   <asp:RequiredFieldValidator ID="PaperRequiredFieldValidator" runat="server" ControlToValidate="DescriptionTextBox"
                                                                       Display="Dynamic" ErrorMessage="*" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                                                               </td>
                                                           </tr>
                                                           <tr>
                                                               <td colspan="2" align="left">
                                                                   <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                                                                       <tr>
                                                                           <td style="height: 15px">&nbsp;
                                                                           </td>
                                                                           <td align="left" valign="top" style="width: 80px;"></td>
                                                                           <td align="left" valign="top" style="width: 80px;"></td>
                                                                       </tr>
                                                                       <tr>
                                                                           <td style="height: 15px">&nbsp;
                                                                           </td>
                                                                           <td align="left" valign="top" style="width: 80px;">
                                                                               <asp:ImageButton ID="InsertButton" runat="server" CommandName="Insert" SkinID="InsertButton"
                                                                                   ValidationGroup="Insert" />
                                                                           </td>
                                                                           <td align="left" valign="top" style="width: 80px;">
                                                                               <asp:ImageButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                                                                   SkinID="CancelButton" />
                                                                           </td>
                                                                       </tr>
                                                                   </table>
                                                               </td>
                                                           </tr>
                                                       </table>
                                                   </InsertItemTemplate>
                                               </asp:FormView>
                                           </td>
                                       </tr>
                                   </table>
                               </td>
                           </tr>
                       </table>
                   </div>
                   <div class="footer">
                       <p>
                           &#169; 2023 Delta System Anahita
                       </p>
                       <ul>
                           <li><a id="A1" href="~/Guest/AboutUs.aspx" runat="server">تماس با ما</a> </li>
                           <li><a id="A2" href="~/Guest/Help.aspx" runat="server">راهنمای پذیرش</a> </li>
                           <li><a id="A3" href="~/Guest/Gallery.aspx" runat="server">گالری</a> </li>
                           <li><a id="A4" href="~/Guest/Paper.aspx" runat="server">مقالات</a> </li>
                           <li><a id="A5" href="~/Guest/TestList.aspx" runat="server">فهرست آزمایشات</a> </li>
                           <li><a id="A6" href="~/Default.aspx" runat="server">صفحه اصلی</a> </li>
                       </ul>
                   </div>
               </div>
            </div>
        </div>
    </div>
    <asp:EntityDataSource ID="PaperEntityDataSource" runat="server" ConnectionString="name=DefaultEntityConnection"
        DefaultContainerName="DefaultEntityConnection" EntitySetName="Papers"
        Where="(@PaperTitle is null || it.PaperTitle LIKE '%' + @PaperTitle + '%')"
        EnableUpdate="True"
        EnableDelete="True"
        EnableInsert="True"
        EnableFlattening="False"
        OnDeleted="PaperEntityDataSource_Command"
        OnInserted="PaperEntityDataSource_Command"
        OnUpdated="PaperEntityDataSource_Command"
        AutoGenerateOrderByClause="True">
        <WhereParameters>
            <asp:ControlParameter ControlID="PaperTitleTextBox" Name="PaperTitle" Type="String" />
        </WhereParameters>
        <OrderByParameters>
            <asp:ControlParameter ControlID="PaperGridView" Name="OrderBy" PropertyName="SortExpression"
                Type="String" />
        </OrderByParameters>
    </asp:EntityDataSource>
    <asp:HiddenField ID="PaperIDHiddenField" runat="server" />
</asp:Content>

